﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DapperExtensions;

namespace RightControl.Model {
     [Table("product")]
    public class ProductDetail : Entity {
         public String SkuId { get; set; }
         
         [Display(Name = "商品标题")]
         public String Title { get; set; }

         [Display(Name = "展示大图")]
         public String ImageUrl { get; set; }

         public String OriProductUrl { get; set; }

         public String Description { get; set; }

         public Decimal Price { get; set; }

         public Decimal SalePrice { get; set; }
         public string CategoryCode { get; set; }

         public int UserId { get; set; }

         public string KeyAttributes { get; set; }

         public string DhAttributes { get; set; }

         public int ProductType { get; set; }

         /// <summary>
         /// 1688类目Id
         /// </summary>
         public string CategoryId { get; set; }

         public ProductDetail() {
         }

         public ProductDetail(int id, int usrId) {
             Id = id;
             UserId = usrId;
         }

         public ProductDetail(string url, int userId, string category = "") {
             OriProductUrl = url;
             UserId = userId;
             CategoryCode = category;
             CreateBy = userId;
             ProductType = 1;
             CreateOn = DateTime.Now;
         }

    }
}
